Skip to content

Conversation

@halspang
Copy link
Member

This commit updates the logging for when a task hub connection returns NotFound. Previously it was logged as an unknown error, it is now a warn.

This commit updates the logging for when a task hub connection
returns NotFound. Previously it was logged as an unknown error,
it is now a warn.

Signed-off-by: halspang <[email protected]>
@halspang halspang force-pushed the halspang/taskhub_notfound_logging branch from 6a5b0dd to 6964e90 Compare April 18, 2025 18:18
}
catch (RpcException ex) when (ex.StatusCode == StatusCode.NotFound)
{
// Task hub is not found or insufficient permissions - retry
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically, 404 Not Found responses are not supposed to be retried. Why would we want to retry in our case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two main reasons I had for this were:

  1. A 404 is returned from the scheduler if the task hub isn't present or if there are insufficient permissions to access it. Given permissions can take time to propagate, I didn't want to have the customer have to go in and restart their worker to get things working again.
  2. A scheduler and a task hub can be deployed in separate steps of a deployment. If the worker is mistakenly put in between them, it would mean the customer has to restart their worker again to get things going.
  3. It's the behavior today (since we retry on unknown) and stopping that may be a breaking change. Who knows what customers depend on so I changed it to at least highlight the log better.

Let me know if you think those are valid reasons or if you think we should change the behavior or add additional sleeping.

Copy link
Member

@cgillum cgillum Apr 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me! Might be worth mentioning this in the comments. (thought this particular code path is agnostic to DTS, so ideally you'd explain it in a more agnostic way :))

@halspang halspang merged commit 33ec0d7 into microsoft:main Apr 18, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants